//
//  BViewController.m
//  PresentVIewController
//
//  Created by student on 16/2/24.
//  Copyright © 2016年 niit. All rights reserved.
//

#import "BViewController.h"
#import "AppDelegate.h"
@interface BViewController ()

@end

@implementation BViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.resultLabel.text = [NSString stringWithFormat:@"%i",self.num];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
  ;
}
-(void)viewDidAppear:(BOOL)animated
{       
    [super viewDidAppear:YES];
    AppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
//    NSLog(@"A presentingViewController%@",appDelegate.window.rootViewController.presentingViewController);
//    NSLog(@"A presentingViewController%@",appDelegate.window.rootViewController.presentedViewController);
//    NSLog(@"B presentingViewController:%@",self.presentingViewController);// 弹出你的视图
//    NSLog(@"B presentedViewController:%@",self.presentedViewController);// 你弹出的视图
    
}
- (IBAction)cancelBtnPressed:(id)sender
{
    [self dismissViewControllerAnimated:YES completion:nil];
}

@end
